package com.yyryyty.chapter5;

import java.util.stream.Stream;

/**
 * @Description :
 * @Author : YTY
 * @Date : 2021-01-17 19:18
 */
public class BuildingStreams {

    public static void main(String[] args) {

//        Stream<String> stream = Stream.of("Java 8", "Lambdas", "In", "Action");
//        stream.map(String::toUpperCase)
//                .forEach(System.out::println);

//        int[] numbers = {2, 3, 5, 7, 11, 13};
//        System.out.println(Arrays.stream(numbers).sum());

//        Stream.iterate(0, n -> n + 2)
//                .limit(10)
//                .forEach(System.out::println);

//        IntStream.rangeClosed(1,100)
//                .boxed()
//                .collect(toList())

        Stream.generate(Math::random)
                .limit(5)
                .forEach(System.out::println);

    }
}
